<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt"%>  
<c:set var="ctx" value="${pageContext.request.contextPath }" />
<link rel="stylesheet"
	href="${ctx }/resources/js/select2/select2.min.css" />
<script type="text/javascript"
	src="${ctx }/resources/js/select2/select2.min.js"></script>
<script type="text/javascript"
	src="${ctx }/resources/js/select2/zh-CN.js"></script>
	<script type="text/javascript">
	 
	    
 
	
</script>
<script src="${ctx }/resources/js/upload/ajaxfileupload.js"
	type="text/javascript"></script>
  
<script type="text/javascript">
  

</script>
<style>
.iconShow
{
	padding-left: 10px; 
	padding-top: 3px;
}
.source-icon
{
	 width:95%;
	 float:left;
}
@media screen and (max-width: 374px){
	.source-icon
	{
		 width:82%;
	}
}
@media screen and (min-width: 375px) and (max-width: 449px){
	.source-icon
	{
		 width:85%;
	}
}
@media screen and (min-width: 450px) and (max-width: 1279px) {
	.source-icon
	{
		 width:90%;
	}
}
@media screen and (min_width: 1280px) {
	.source-icon
	{
		 width:90%;
	}
}
</style>
<div class="page-header">
	<h1>
		 
		<c:if test="${!empty bdictionary}">
		编辑SEO管理
		</c:if>
	</h1>
</div><!--  -->
<div class="row" style="margin-top: 5px;">
	<div class="col-xs-12">
		<form id="seoForm" name="seoForm" class="form-horizontal" role="form" method="post">
			<c:if test="${!empty bdictionary}">
				<input type="hidden" id="pageNum" name="pageNum" value="${page.pageNum }"> 
				<input type="hidden" id="pageSize" name="pageSize" value="${page.pageSize }"> 
				<input type="hidden" id="orderByColumn" name="orderByColumn" value="${page.orderByColumn }"> 
				<input type="hidden" id="orderByType" name="orderByType" value="${page.orderByType }">
				<input type="hidden"  id='id' name="id" value="${bdictionary.id }">
				<input type="hidden"  id='code' name="code" value="${bdictionary.code }">
			</c:if>
		   <c:forEach items="${list}" var="list">  
			<div class="form-group">
				<label class="control-label col-sm-1 no-padding-right" for="name" >首页标题</label>
				<div class="col-sm-10">
				<div class="clearfix">
					<input class="form-control" name="name" id="indexT" type="text"
					<%-- <c:if test="${list.type eq 'INDEX_SEO' && list.code eq 'TITLE_INDEX'}"> value="${list.name}"</c:if> --%>
					placeholder="" value="${list.name}"/>
                </div>
				</div>
              </div>
               </c:forEach>  
              <c:forEach items="${listWord}" var="list">     
             <div class="form-group">
				<label class="control-label col-sm-1 no-padding-right" for="name">首页关键词</label>
				<div class="col-sm-10">
				<div class="clearfix">
					<input class="form-control" name="name" id="indexK" type="text"
						<%--  <c:if test="${list.type eq 'INDEX_SEO' && list.code eq 'KEYWORDS_INDEX'}">value="${list.name}"</c:if>  --%>
						 value="${list.name}" placeholder="" />
                </div>
				</div>
            </div>
            </c:forEach>
			<c:forEach items="${listIndex}" var="list"> 
			<div class="form-group">
				<label class="control-label col-sm-1 no-padding-right" for="name">首页描述</label>
				<div class="col-sm-10">
				<div class="clearfix">
					<input class="form-control" name="name" id="indexD" type="text"
						<%-- <c:if test="${list.code eq 'DESCRIPTION_INDEX'}">value="${list.name}"</c:if> --%>
						  value="${list.name}" />
                </div>
				</div>
            </div>
            </c:forEach>
            <c:forEach items="${listTitle}" var="list"> 
            <div class="form-group">
				<label class="control-label col-sm-1 no-padding-right" for="name">搜索页标题</label>
				<div class="col-sm-10">
				<div class="clearfix">
					<input class="form-control" name="name" id="searchT" type="text"
					<%-- <c:if test="${list.code eq 'TITLE_RESEARCH'}">value="${list.name}"</c:if> --%>
					value="${list.name}" />
                </div>
				</div>
            </div>
            </c:forEach>
            <c:forEach items="${listResearch}" var="list"> 
            <div class="form-group">
				<label class="control-label col-sm-1 no-padding-right" for="name">搜索页关键词</label>
				<div class="col-sm-10">
				<div class="clearfix">
					<input class="form-control" name="name" id="searchK" type="text"
					<%-- <c:if test="${list.code eq 'KEYWORDS_RESEARCH'}">value="${list.name}"</c:if>  --%>
					value="${list.name}" />
                </div>
				</div>
            </div>
            </c:forEach>
            <c:forEach items="${listMeishu}" var="list"> 
            <div class="form-group">
				<label class="control-label col-sm-1 no-padding-right" for="name">搜索页描述</label>
				<div class="col-sm-10">
				<div class="clearfix">
					<input class="form-control" name="name" id="searchD" type="text"
					<%-- <c:if test="${list.code eq 'DESCRIPTION_RESEARCH'}">value="${list.name}"</c:if>--%>
					value="${list.name}" />
                </div>
				</div>
            </div>  
           </c:forEach>
           
            <c:forEach items="${listSearch}" var="list"> 
            <div class="form-group">
				<label class="control-label col-sm-1 no-padding-right" for="name">搜索框关键词</label>
				<div class="col-sm-10">
				<div class="clearfix">
					<input class="form-control" name="name" id="searcsD" type="text"
					value="${list.name}" />
                </div>
				</div>
            </div>  
            </c:forEach>
              		
		</form>
		<div class="hr hr-dotted"></div>
	</div>
</div>
<div class="center">
	<button id="btnAdd" type="button" 
		onclick="tj();" 
	class="btn btn-success btn-sm">
		<i class="fa fa-user-plus"></i>&nbsp;
		保存
	</button>
	
</div>
  <script type="text/javascript">
  function tj(){
	 	 var it=$("#indexT").val();
	  	 var ik=$("#indexK").val();
	  	 var id=$("#indexD").val();
	  	 var rt=$("#searchT").val();
	  	 var rk=$("#searchK").val();
	  	 var rd=$("#searchD").val();
	     var rs=$("#searcsD").val();
	  	$.ajax({
	  		url:"${pageContext.request.contextPath }/seo/edit.html",
	  		type:"post",
	  		data:{it:it,ik:ik,id:id,rt:rt,rk:rk,rd:rd,rs:rs},
	  		dataType:"json",
	  		success:function(data){
	  			if(data.success){
	  				layer.msg('保存成功！', {
						icon : 1
					});
	  			}else{
	  				layer.msg('修改失败！', {
						icon : 0
					});
	  			}
	  		}
	  		
	  	});
  }
  	
  </script>